
library(testthat)
library(blma)
library(tictoc)
library(parallel)

cores <- detectCores()

test_that("Kakadu produces correct results BIC", {
	Kakadu <- get_Kakadu()
	vy <- Kakadu$vy
	mX <- Kakadu$mX
	tic("Kakadu produces correct results BIC")
	result <- blma(vy, mX, prior="BIC", modelprior="uniform", cores=cores)
	toc()
	expect_equal(result$vinclusion_prob, c(
		0.11956375866122319,0.43598166701152036,0.03004602756871903,
		0.37141951236536819,0.81868011537400154,0.16833752435869168,
		0.03221165979213939,0.04298271555297178,0.02617847083497719,
		0.52531028106054500,0.92513375271585307,0.99815130365593652,
		0.02454673388614505,0.08100948178569978,0.08169622092074036,
		0.62985862997075337,0.03271752259200703,0.54749994288839865,
		0.99999999999905875,0.26634597085271527,0.99999886673686156,
		0.04953096133476929
	), tolerance = 1e-8)
})